const mongoose = require("mongoose")
const schema = new mongoose.Schema(
  {
    user: {
      type: mongoose.Types.ObjectId,
      ref: "User",
      required: true,
      unique: true,
    },
    title: String,
    imgUrl: {
      type: String,
      default: "http://localhost:3000/upload/res/img/default.jpg",
    },
    publishUrl: String,
    playUrl: String,
    onLive: { type: Boolean, default: false },
  },
  {
    timestamps: true,
  }
)
// schema.virtual('user',{
  
//   ref:'User',

// })
module.exports = mongoose.model("Live", schema)
